/* global window */
/**
 * @auth: sce
 * @date: 18-4-1
 * @desc: 处理token信息的存储问题
 * */

const SessionStorageHandler = function () {
}
SessionStorageHandler.prototype = {
  getSessionObject () {
    return window.sessionStorage
  },
  getSessionByKey (key) {
    return this.getSessionObject().getItem(key)
  },
  setSessionByKey (key, value) {
    this.getSessionObject().setItem(key, value)
  },
  removeSessionByKey (key) {
    this.getSessionObject().removeItem(key)
  },
  clearSession () {
    this.getSessionObject().clear()
  },
}
module.exports = new SessionStorageHandler()
